/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_transaction_mk_work_order")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findAll", query = "SELECT p FROM PosTransactionMkWorkOrder p"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findBySync", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderId", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderId = :workOrderId"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderNumber", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderNumber = :workOrderNumber"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderDate", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderDate = :workOrderDate"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderStatus", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderStatus = :workOrderStatus"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderKeel", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderKeel = :workOrderKeel"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderTotal", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderTotal = :workOrderTotal"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderQuantity", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderQuantity = :workOrderQuantity"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderPaid", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderPaid = :workOrderPaid"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderReceived", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderReceived = :workOrderReceived"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderUnreceived", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderUnreceived = :workOrderUnreceived"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderProgress", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderProgress = :workOrderProgress"),
//    @NamedQuery(name = "PosTransactionMkWorkOrder.findByWorkOrderTimestamp", query = "SELECT p FROM PosTransactionMkWorkOrder p WHERE p.workOrderTimestamp = :workOrderTimestamp")})
public class PosTransactionMkWorkOrder implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "work_order_id")
    private Integer workOrderId;
    @Column(name = "work_order_number")
    private String workOrderNumber;
    @Column(name = "work_order_date")
    @Temporal(TemporalType.DATE)
    private Date workOrderDate;
    @Column(name = "work_order_status")
    private String workOrderStatus;
    @Column(name = "work_order_keel")
    private String workOrderKeel;
    @Column(name = "work_order_total")
    private BigDecimal workOrderTotal;
    @Column(name = "work_order_quantity")
    private BigDecimal workOrderQuantity;
    @Column(name = "work_order_paid")
    private BigDecimal workOrderPaid;
    @Column(name = "work_order_received")
    private BigDecimal workOrderReceived;
    @Column(name = "work_order_unreceived")
    private BigDecimal workOrderUnreceived;
    @Column(name = "work_order_progress")
    private String workOrderProgress;
    @Lob
    @Column(name = "work_order_description")
    private String workOrderDescription;
    @Column(name = "work_order_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date workOrderTimestamp;
    @JoinColumn(name = "work_order_pos_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private PosMasterUnit workOrderPosUnitId;
    @JoinColumn(name = "work_order_regional_id", referencedColumnName = "regional_id")
    @ManyToOne(optional = false)
    private PosMasterRegional workOrderRegionalId;
    @JoinColumn(name = "work_order_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit workOrderUnitId;
    @JoinColumn(name = "work_order_user_id", referencedColumnName = "user_id")
    @ManyToOne
    private MasterUser workOrderUserId;
   
    public PosTransactionMkWorkOrder() {
    }

    public PosTransactionMkWorkOrder(Integer workOrderId) {
        this.workOrderId = workOrderId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getWorkOrderId() {
        return workOrderId;
    }

    public void setWorkOrderId(Integer workOrderId) {
        this.workOrderId = workOrderId;
    }

    public String getWorkOrderNumber() {
        return workOrderNumber;
    }

    public void setWorkOrderNumber(String workOrderNumber) {
        this.workOrderNumber = workOrderNumber;
    }

    public Date getWorkOrderDate() {
        return workOrderDate;
    }

    public void setWorkOrderDate(Date workOrderDate) {
        this.workOrderDate = workOrderDate;
    }

    public String getWorkOrderStatus() {
        return workOrderStatus;
    }

    public void setWorkOrderStatus(String workOrderStatus) {
        this.workOrderStatus = workOrderStatus;
    }

    public String getWorkOrderKeel() {
        return workOrderKeel;
    }

    public void setWorkOrderKeel(String workOrderKeel) {
        this.workOrderKeel = workOrderKeel;
    }

    public BigDecimal getWorkOrderTotal() {
        return workOrderTotal;
    }

    public void setWorkOrderTotal(BigDecimal workOrderTotal) {
         this.workOrderTotal = workOrderTotal;
    }

    public BigDecimal getWorkOrderQuantity() {
        return workOrderQuantity;
    }

    public void setWorkOrderQuantity(BigDecimal workOrderQuantity) {
        this.workOrderQuantity = workOrderQuantity;
    }

    public BigDecimal getWorkOrderPaid() {
        return workOrderPaid;
    }

    public void setWorkOrderPaid(BigDecimal workOrderPaid) {
        this.workOrderPaid = workOrderPaid;
    }

    public BigDecimal getWorkOrderReceived() {
        return workOrderReceived;
    }

    public void setWorkOrderReceived(BigDecimal workOrderReceived) {
        this.workOrderReceived = workOrderReceived;
    }

    public BigDecimal getWorkOrderUnreceived() {
        return workOrderUnreceived;
    }

    public void setWorkOrderUnreceived(BigDecimal workOrderUnreceived) {
        this.workOrderUnreceived = workOrderUnreceived;
    }


    public String getWorkOrderProgress() {
        return workOrderProgress;
    }

    public void setWorkOrderProgress(String workOrderProgress) {
        this.workOrderProgress = workOrderProgress;
    }

    public String getWorkOrderDescription() {
        return workOrderDescription;
    }

    public void setWorkOrderDescription(String workOrderDescription) {
        this.workOrderDescription = workOrderDescription;
    }

    public Date getWorkOrderTimestamp() {
        return workOrderTimestamp;
    }

    public void setWorkOrderTimestamp(Date workOrderTimestamp) {
        this.workOrderTimestamp = workOrderTimestamp;
    }

    public PosMasterUnit getWorkOrderPosUnitId() {
        return workOrderPosUnitId;
    }

    public void setWorkOrderPosUnitId(PosMasterUnit workOrderPosUnitId) {
        this.workOrderPosUnitId = workOrderPosUnitId;
    }

    public PosMasterRegional getWorkOrderRegionalId() {
        return workOrderRegionalId;
    }

    public void setWorkOrderRegionalId(PosMasterRegional workOrderRegionalId) {
        this.workOrderRegionalId = workOrderRegionalId;
    }

    public MasterUnit getWorkOrderUnitId() {
        return workOrderUnitId;
    }

    public void setWorkOrderUnitId(MasterUnit workOrderUnitId) {
        this.workOrderUnitId = workOrderUnitId;
    }

    public MasterUser getWorkOrderUserId() {
        return workOrderUserId;
    }

    public void setWorkOrderUserId(MasterUser workOrderUserId) {
        this.workOrderUserId = workOrderUserId;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (workOrderId != null ? workOrderId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionMkWorkOrder)) {
            return false;
        }
        PosTransactionMkWorkOrder other = (PosTransactionMkWorkOrder) object;
        if ((this.workOrderId == null && other.workOrderId != null) || (this.workOrderId != null && !this.workOrderId.equals(other.workOrderId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return workOrderNumber;
//        return "com.ronsicecream.pos.entities.PosTransactionMkWorkOrder[ workOrderId=" + workOrderId + " ]";
    }
    
}
